<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>系统后台 - <?php echo (C("INTENDANT_NAME")); ?> - by HemaCMS</title>
    <link href="/Public/intendant/css/admin_style.css" rel="stylesheet" />
    <script src="/Public/common/js/jquery.js"></script>
    <script src="/Public/common/js/jquery.cookie.js"></script>
    <script src="/Public/common/js/jquery.idTabs.min.js"></script>
    <script src="/Public/common/js/layer/layer.js"></script>
    <script src="/Public/intendant/js/iteny.intendant.js"></script> <!-- 公共easyui JS -->
    <link href="/Public/intendant/css/iteny.css" rel="stylesheet" />
</head>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
    <div class="nav">
  	    <ul class="idTabs cc">
          <li><a href="#siteset">站点设置</a></li>
          <li><a href="#email">邮箱设置</a></li>
          <li><a href="#adminset">后台设置</a></li>
        </ul>
  	</div>

<!-- <div>If you haven't checked out ...</div>
<div id="official">idTabs is only a simple ...</div> -->
    <div class="table_list">
      <form method='post'   id="myform" class="J_ajaxForm"  action="<?php echo U('Site/setconfig');?>">
      <input type="hidden" name="setconfig" value="setconfig" />
        <div id="siteset">
          <div class="h_a">站点配置</div>
          <div class="table_full">
            <table cellpadding=0 cellspacing=0 width="100%" class="table_form">
              <tr>
      	         <th width="140">站点名称:</th>
      	         <td>
                    <input type="text" class="input"  name="INTENDANT_NAME" value="<?php echo (C("INTENDANT_NAME")); ?>" size="40">
                  </td>
              </tr>
              <tr>
        	       <th width="140">网站访问地址:</th>
        	       <td>
                    <input type="text" class="input"  name="siteurl" value="<?php echo ($Site["WOSHI"]); ?>" size="40"> <span class="gray"> 请以“/”结尾</span>
                  </td>
              </tr>
              <tr>
        	        <th width="140">附件访问地址:</th>
        	        <td>
                      <input type="text" class="input"  name="sitefileurl" value="<?php echo ($Site["sitefileurl"]); ?>" size="40"> <span class="gray"> 非上传目录设置</span>
                  </td>
              </tr>
              <tr>
        	         <th width="140">联系邮箱:</th>
        	         <td>
                      <input type="text" class="input"  name="siteemail" value="<?php echo ($Site["siteemail"]); ?>" size="40">
                   </td>
              </tr>
              <tr>
            	     <th width="140">网站关键字:</th>
            	     <td>
                      <input type="text" class="input"  name="sitekeywords" value="<?php echo ($Site["sitekeywords"]); ?>" size="40">
                   </td>
              </tr>
              <tr>
            	     <th width="140">网站简介:</th>
            	     <td>
                      <textarea name="siteinfo" style="width:380px; height:150px;"><?php echo ($Site["siteinfo"]); ?></textarea>
                   </td>
              </tr>
              <tr>
            	     <th width="140">后台指定域名访问:</th>
            	     <td><select name="domainaccess" id="domainaccess" >
                        <option value="1" <?php if($Site['domainaccess'] == '1' ): ?>selected<?php endif; ?>>开启指定域名访问</option>
                        <option value="0" <?php if($Site['domainaccess'] == '0' ): ?>selected<?php endif; ?>>关闭指定域名访问</option>
                      </select> <span class="gray"> （该功能需要配合“域名绑定”模块使用，需要在域名绑定模块中添加域名！）</span></td>
              </tr>
              <tr>
            	     <th width="140">是否生成首页:</th>
            	     <td><select name="generate" id="generate" onChange="generates(this.value);">
                        <option value="1" <?php if($Site['generate'] == '1' ): ?>selected<?php endif; ?>>生成静态</option>
                        <option value="0" <?php if($Site['generate'] == '0' ): ?>selected<?php endif; ?>>不生成静态</option>
                      </select></td>
              </tr>
              <tr>
            	     <th width="140">首页模板:</th>
            	     <td><select name="indextp" id="indextp">
                        <?php if(is_array($indextp)): $i = 0; $__LIST__ = $indextp;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo); ?>" <?php if($Site['indextp'] == $vo): ?>selected<?php endif; ?>><?php echo ($vo); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                      </select>
            	     span></td>
              </tr>
              <tr>
            	     <th width="140">验证码类型:</th>
            	     <td><select name="checkcode_type">
                     	<option value="0" <?php if($Site['checkcode_type'] == '0' ): ?>selected<?php endif; ?>>数字字母混合</option>
                        <option value="1" <?php if($Site['checkcode_type'] == '1' ): ?>selected<?php endif; ?>>纯数字</option>
                        <option value="2" <?php if($Site['checkcode_type'] == '2' ): ?>selected<?php endif; ?>>纯字母</option>
                      </select></td>
              </tr>
            </table>
          </div>
        </div>
        <div id="email">
          <div class="h_a">邮箱设置</div>
          <div class="table_full">
            <table cellpadding=0 cellspacing=0 width="100%" class="table_form">
              <tr>
                <th width="140">你的邮箱:</th>
                <td>
                  <input type="text" class="input"  name="YOUR_EMAIL" value="<?php echo (C("YOUR_EMAIL")); ?>" size="40">
                </td>
              </tr>
              <tr>
                <th width="140">你的邮箱密码:</th>
                <td>
                  <input type="text" class="input"  name="YOUR_EMAIL_PWD" value="<?php echo (C("YOUR_EMAIL_PWD")); ?>" size="40">
                </td>
              </tr>
            </table>
          </div>
        </div>
        <div id="adminset">
          <div class="h_a">后台设置</div>
          <div class="table_full">
            <table cellpadding=0 cellspacing=0 width="100%" class="table_form">
              <tr>
                <th width="140">站点名称:</th>
                <td>
                  <input type="text" class="input"  name="sitename" value="<?php echo ($Site["WEBNAME"]); ?>" size="40">
                </td>
              </tr>
            </table>
          </div>
        </div>
        <div class="btn_wrap">
          <div class="btn_wrap_pd">
            <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">提交</button>
          </div>
        </div>
      </form>
    </div>
</div>
<script type="text/javascript">
$(function(){
    $('button.J_ajax_submit_btn').on('click', function (e) {
      e.preventDefault();
      var btn = $(this),
          form = btn.parents('form.J_ajaxForm');
          if(btn.attr("disabledSubmit")){
            btn.text('请勿重复提交...').prop('disabled', true).addClass('disabled');
            return false;
        }
      btn.attr("disabledSubmit",true);
        var param = form.serialize();
        $.ajax({
        url: form.attr('action'),
        dataType:'json',
        type:'POST',
        data:param,
        beforeSend: function(){
          layer.load(1);
        },
        success: function(data){
          layer.close(layer.load(1));
          if(!data.status){
            ITENY.alert('提示信息',data.info,2,'3000');

          } else {
            ITENY.alert('提示信息',data.info,1,'3000');
            setTimeout(function(){
                      ITENY.reloadPage(window);
                  },3000);

          }
        },
        error: function(data){
          layer.close(layer.load(1));
          ITENY.alert('提示信息',data.responseText,1,'3000');

        }
      });
    });
});
</script>
</body>
</html>